#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/visualization/cloud_viewer.h>

//using namespace pcl;

//READ IN .PCD FILE

int
main (int argc, char** argv)
{
  //Creates a new point_cloud structure called cloud1 that will be used for the program
  pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);

  //If the running the LoadPCDFile process returns a value of -1, the file was not read in correctly. Calling loadPLYFile actually reads in the file and assigns it to "cloud1." 

  if (pcl::io::loadPCDFile (argv[1], *cloud) == -1) //* load the file
  {
    PCL_ERROR ("Couldn't read file\n");
    return (-1);
  }
  //write to the screen if the file was read in correctly
  std::cout << "THE FILE WAS LOADED \n";

  //Run the visualizer which will display the Point Cloud called "cloud1"
  pcl::visualization::CloudViewer viewer ("Simple Cloud Viewer");

       viewer.showCloud (cloud);

       while (!viewer.wasStopped ())

       {
       }

  return (0);
}

